package main

import (
	"fmt"
	"unsafe"
)

func main() {
	//整型，数值类型
	/*
		int8	1		-2^7~2^7-1
		int16	2		-2^15~2^15-1
		int32	4		-2^31~2^31-1
		int64	8		-2^63~2^63-1

		uint8	1       0~2^0-1
		uint16	2       0~2^16-1
		uint32	4       0~2^32-1
		uint64	8       0~2^64-1
	*/

	var intVariables1 = 100 //int
	intVariables2 := 200    //int
	var intVariables3 int32 //int32
	intVariables := 126     //int

	//数据转换
	intVariables3 = int32(intVariables)

	var intVariables4 int64 = 123456789
	fmt.Printf("intVariables1=%T,intVariables2=%T,intVariables3=%T\n", intVariables1, intVariables2, intVariables3)

	//unsafe.Sizeof得出占用字节数
	fmt.Println(unsafe.Sizeof(intVariables4))
}
